package itcz.example.pattern.create_action.factory.config_factory;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

/**
 * @ClassName: Client
 * @Author: ITCZ
 * @Date: 2025-05-02
 * @Description: 配置文件+工厂
 */
public class Client {
    public static void main(String[] args) {

        Coffee coffee = CoffeeFactory.createCoffee("american");
        System.out.println(coffee.getName());

        Coffee coffee2 = CoffeeFactory.createCoffee("latte");
        System.out.println(coffee2.getName());


        List<String> list = new ArrayList<>();
        list.add("A");
        list.add("B");
        list.add("C");

        Iterator<String> iterator = list.iterator();
        while (iterator.hasNext()) {
            String next = iterator.next();
            System.out.println(next);
        }
    }
}
